﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JN.Utility;
namespace Power.Common.Notify
{
    public static class NotifyMessage
    {
        public static void Show(string cate, string info)
        {
            NotifyForm notifys = new NotifyForm();
            notifys.IsAutoClose = false;
            notifys.MessageCate = cate;
            notifys.MessageInfo = info;
            notifys.ShowDialog();
        }
        public static void Show(string cate, string info, bool isAutoClose)
        {
            NotifyForm notifys = new NotifyForm();
            notifys.IsAutoClose = isAutoClose;
            notifys.MessageCate = cate;
            notifys.MessageInfo = info;
            notifys.ShowDialog();
        }
        public static void Show(Exception ex)
        {
            SystemLogger.Write(ex);

            NotifyForm notifys = new NotifyForm();
            notifys.IsAutoClose = true;
            notifys.MessageCate = "Exception";
            notifys.MessageInfo = ex.ToString();
            notifys.ShowDialog();
        }
        public static void ShowNoDialog(string cate, string info)
        {
            NotifyForm notifys = new NotifyForm();
            notifys.IsAutoClose = true;
            notifys.MessageCate = cate;
            notifys.MessageInfo = info;
            notifys.ShowDialog();
        }
    }
}
